3.1.14 \(\int \frac {\csc (x)}{a+b \cos ^2(x)} \, dx\) [14]

Optimal. Leaf size=42 \[ -\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \]

[Out]

-arctanh(cos(x))/(a+b)-arctan(cos(x)*b^(1/2)/a^(1/2))*b^(1/2)/(a+b)/a^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 42, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3269, 400, 212, 211} \begin {gather*} -\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + b*Cos[x]^2),x]

[Out]

-((Sqrt[b]*ArcTan[(Sqrt[b]*Cos[x])/Sqrt[a]])/(Sqrt[a]*(a + b))) - ArcTanh[Cos[x]]/(a + b)

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 400

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 3269

Int[cos[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b*ff^2*x^2)^p, x], x, Sin[e +
f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a+b \cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\cos (x)\right )\\ &=-\frac {\text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\cos (x)\right )}{a+b}-\frac {b \text {Subst}\left (\int \frac {1}{a+b x^2} \, dx,x,\cos (x)\right )}{a+b}\\ &=-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a} (a+b)}-\frac {\tanh ^{-1}(\cos (x))}{a+b}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.05, size = 50, normalized size = 1.19 \begin {gather*} \frac {-\frac {2 \sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \cos (x)}{\sqrt {a}}\right )}{\sqrt {a}}+\log (1-\cos (x))-\log (1+\cos (x))}{2 (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + b*Cos[x]^2),x]

[Out]

((-2*Sqrt[b]*ArcTan[(Sqrt[b]*Cos[x])/Sqrt[a]])/Sqrt[a] + Log[1 - Cos[x]] - Log[1 + Cos[x]])/(2*(a + b))

________________________________________________________________________________________

Maple [A]
time = 0.13, size = 56, normalized size = 1.33

method result size
default \(-\frac {\ln \left (\cos \left (x \right )+1\right )}{2 a +2 b}+\frac {\ln \left (-1+\cos \left (x \right )\right )}{2 a +2 b}-\frac {b \arctan \left (\frac {b \cos \left (x \right )}{\sqrt {a b}}\right )}{\left (a +b \right ) \sqrt {a b}}\) \(56\)
risch \(-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a +b}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a +b}+\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )}-\frac {i \sqrt {a b}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 i \sqrt {a b}\, {\mathrm e}^{i x}}{b}+1\right )}{2 a \left (a +b \right )}\) \(111\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+b*cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

-1/(2*a+2*b)*ln(cos(x)+1)+1/(2*a+2*b)*ln(-1+cos(x))-b/(a+b)/(a*b)^(1/2)*arctan(b*cos(x)/(a*b)^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.48, size = 48, normalized size = 1.14 \begin {gather*} -\frac {b \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (\cos \left (x\right ) - 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="maxima")

[Out]

-b*arctan(b*cos(x)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - 1/2*log(cos(x) + 1)/(a + b) + 1/2*log(cos(x) - 1)/(a + b)

________________________________________________________________________________________

Fricas [A]
time = 0.45, size = 113, normalized size = 2.69 \begin {gather*} \left [\frac {\sqrt {-\frac {b}{a}} \log \left (\frac {b \cos \left (x\right )^{2} - 2 \, a \sqrt {-\frac {b}{a}} \cos \left (x\right ) - a}{b \cos \left (x\right )^{2} + a}\right ) - \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}, -\frac {2 \, \sqrt {\frac {b}{a}} \arctan \left (\sqrt {\frac {b}{a}} \cos \left (x\right )\right ) + \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right )}{2 \, {\left (a + b\right )}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/a)*log((b*cos(x)^2 - 2*a*sqrt(-b/a)*cos(x) - a)/(b*cos(x)^2 + a)) - log(1/2*cos(x) + 1/2) + log(
-1/2*cos(x) + 1/2))/(a + b), -1/2*(2*sqrt(b/a)*arctan(sqrt(b/a)*cos(x)) + log(1/2*cos(x) + 1/2) - log(-1/2*cos
(x) + 1/2))/(a + b)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\csc {\left (x \right )}}{a + b \cos ^{2}{\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)**2),x)

[Out]

Integral(csc(x)/(a + b*cos(x)**2), x)

________________________________________________________________________________________

Giac [A]
time = 0.42, size = 50, normalized size = 1.19 \begin {gather*} -\frac {b \arctan \left (\frac {b \cos \left (x\right )}{\sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} - \frac {\log \left (\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} + \frac {\log \left (-\cos \left (x\right ) + 1\right )}{2 \, {\left (a + b\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+b*cos(x)^2),x, algorithm="giac")

[Out]

-b*arctan(b*cos(x)/sqrt(a*b))/(sqrt(a*b)*(a + b)) - 1/2*log(cos(x) + 1)/(a + b) + 1/2*log(-cos(x) + 1)/(a + b)

________________________________________________________________________________________

Mupad [B]
time = 2.67, size = 853, normalized size = 20.31 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \left (x\right )\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}-\frac {\left (\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \left (x\right )\right )\,1{}\mathrm {i}}{2\,\left (a+b\right )}}{\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2-\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}+4\,b^3\,\cos \left (x\right )}{2\,\left (a+b\right )}+\frac {\frac {8\,a\,b^3+4\,b^4+4\,a^2\,b^2+\frac {\cos \left (x\right )\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{2\,\left (a+b\right )}}{2\,\left (a+b\right )}-4\,b^3\,\cos \left (x\right )}{2\,\left (a+b\right )}}\right )\,1{}\mathrm {i}}{a+b}+\frac {\mathrm {atan}\left (\frac {\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}+\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )\,1{}\mathrm {i}}{a^2+b\,a}}{\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )+\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2-\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}-\frac {\sqrt {-a\,b}\,\left (2\,b^3\,\cos \left (x\right )-\frac {\sqrt {-a\,b}\,\left (4\,a\,b^3+2\,b^4+2\,a^2\,b^2+\frac {\cos \left (x\right )\,\sqrt {-a\,b}\,\left (-8\,a^3\,b^2-8\,a^2\,b^3+8\,a\,b^4+8\,b^5\right )}{4\,\left (a^2+b\,a\right )}\right )}{2\,\left (a^2+b\,a\right )}\right )}{a^2+b\,a}}\right )\,\sqrt {-a\,b}\,1{}\mathrm {i}}{a\,\left (a+b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a + b*cos(x)^2)),x)

[Out]

(atan(((((8*a*b^3 + 4*b^4 + 4*a^2*b^2 - (cos(x)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(2*(a + b)))/(2*(a
+ b)) + 4*b^3*cos(x))*1i)/(2*(a + b)) - (((8*a*b^3 + 4*b^4 + 4*a^2*b^2 + (cos(x)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3
- 8*a^3*b^2))/(2*(a + b)))/(2*(a + b)) - 4*b^3*cos(x))*1i)/(2*(a + b)))/(((8*a*b^3 + 4*b^4 + 4*a^2*b^2 - (cos(
x)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(2*(a + b)))/(2*(a + b)) + 4*b^3*cos(x))/(2*(a + b)) + ((8*a*b^3
 + 4*b^4 + 4*a^2*b^2 + (cos(x)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(2*(a + b)))/(2*(a + b)) - 4*b^3*cos
(x))/(2*(a + b))))*1i)/(a + b) + (atan((((-a*b)^(1/2)*(2*b^3*cos(x) + ((-a*b)^(1/2)*(4*a*b^3 + 2*b^4 + 2*a^2*b
^2 - (cos(x)*(-a*b)^(1/2)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b + a^2))))/(2*(a*b + a^2)))*1i)/(a
*b + a^2) + ((-a*b)^(1/2)*(2*b^3*cos(x) - ((-a*b)^(1/2)*(4*a*b^3 + 2*b^4 + 2*a^2*b^2 + (cos(x)*(-a*b)^(1/2)*(8
*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b + a^2))))/(2*(a*b + a^2)))*1i)/(a*b + a^2))/(((-a*b)^(1/2)*(2
*b^3*cos(x) + ((-a*b)^(1/2)*(4*a*b^3 + 2*b^4 + 2*a^2*b^2 - (cos(x)*(-a*b)^(1/2)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 -
 8*a^3*b^2))/(4*(a*b + a^2))))/(2*(a*b + a^2))))/(a*b + a^2) - ((-a*b)^(1/2)*(2*b^3*cos(x) - ((-a*b)^(1/2)*(4*
a*b^3 + 2*b^4 + 2*a^2*b^2 + (cos(x)*(-a*b)^(1/2)*(8*a*b^4 + 8*b^5 - 8*a^2*b^3 - 8*a^3*b^2))/(4*(a*b + a^2))))/
(2*(a*b + a^2))))/(a*b + a^2)))*(-a*b)^(1/2)*1i)/(a*(a + b))

________________________________________________________________________________________